############################################################## 
## MOD Title: Fantasy Sports MOD 
## MOD Author: JSLayton < slayton5799@charter.net > (N/A) http://talkabout.hopto.org
## MOD Traduccion: reef_01 - http://www.piratesdelcaribe.com.ar/foro/index.php
##
## MOD Description: Este MOD permite a los usuarios puedan predecir los resultados de los eventos deportivos.   
##
## MOD Version: 1.0.7
##
##      Version 1.0.0 - Initial Release
##      Version 1.0.1 - Fixed Problem with adding users to stats db and fixed editing gametime problem. 
##      Version 1.0.2 - Fixed Problem with editing games. (Wouldn't edit more than two games at a time)
##      Version 1.0.3 - Made it where games that end in 0-0 will still be included in the stats
##      Version 1.0.4 - Cosmetic changes to some of the files.  Thanks to helluvaguy!
##      Version 1.0.5 - Fixed a problem to allow 0-0 final scores and added a tie column to the percentage table.
##      Version 1.0.6 - After changing the 0-0 score, had a MAJOR problem with calculating stats.  Problem SOLVED!!!!
##      Version 1.0.7 - Thanks to John9 for fixing the problem with predictions and the problem with adding and editing teams
## 
## Installation Level: Facil 
## Installation Time: 10 Minutos 
## Files To Edit: viewonline.php,
##		  admin/index.php,
##		  includes/constants.php, 
##		  includes/page_header.php,
##		  language/lang_english/lang_main.php,
##		  language/lang_spanish/lang_main.php,
##		  templates/subSilver/overall_header.tpl
##		  
## Included Files: fsports_db_update.php,
##		   fsports.php,
##		   fsports_pred.php,	 
##		   functions_fsports.php,
##		   admin_fsports.php,
##		   admin_fsports.tpl
##		   fsports_body.tpl, 
##		   fsportspred_body.tpl,
##
############################################################## 
############################################################## 
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD 
##
## MUCH THANKS TO JOHNMCK, THOUL, A_JELLY_DOUGHNUT, AND THE REST OF THE GUYS WHO HAVE HELPED ME OUT WITH THIS
##
## ALL SUPPORT FOR THIS HACK WILL BE GIVEN EITHER AT http://www.phpbbhacks.com OR MY WEBSITE http://fantasysports.hopto.org
##
############################################################## 
############################################################## 

# 
#-----[ COPY ]------------------------------------------ 
# 
copy fsports.php to fsports.php 
copy fsports_pred.php to fsports_pred.php 
copy functions_fsports.php to includes/functions_fsports.php
copy fsports_body.tpl to templates/subSilver/fsports_body.tpl
copy fsportspred_body.tpl to templates/subSilver/fsports_body.tpl
copy admin_fsports.php to admin/admin_fsports.php
copy admin_fsgames.php to admin/admin_fsgames.php
copy admin_fsteams.php to admin/admin_fsteams.php
copy admin_fsscores.php to admin/admin_fsscores.php
copy admin_fsports.tpl to templates/subSilver/admin/admin_fsports.tpl
copy fs_games.tpl to templates/subSilver/admin/fs_games.tpl
copy fs_add_games.tpl to templates/subSilver/admin/fs_add_games.tpl
copy fs_edit_games.tpl to templates/subSilver/admin/fs_edit_games.tpl
copy fs_teams.tpl to templates/subSilver/admin/fs_teams.tpl
copy fs_add_team.tpl to templates/subSilver/admin/fs_add_team.tpl
copy fs_edit_team_list.tpl to templates/subSilver/admin/fs_edit_team_list.tpl
copy fs_delete_team.tpl to templates/subSilver/admin/fs_delete_team.tpl
copy fs_scores.tpl to templates/subSilver/admin/fs_scores.tpl
copy fs_edit_scores.tpl to templates/subSilver/admin/fs_edit_scores.tpl
copy t_icon_predict.gif to templates/subSilver/images/t_icon_predict.gif

# 
#-----[ SQL ]------------------------------------------ 
# 

copy fsports_db_update.php to fsports_db_update.php
run fsports_db_update.php
delete fsports_db_update.php

# 
#-----[ OPEN ]------------------------------------------ 
# 

viewonline.php

# 
#-----[ FIND ]------------------------------------------ 
# 

				case PAGE_FAQ:
					$location = $lang['Viewing_FAQ'];
					$location_url = "faq.$phpEx";
					break;

# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 

				case PAGE_SPORTS:
					$location = $lang['viewonlinesports'];
					$location_url = "fsports.$phpEx";
					break;

# 
#-----[ OPEN ]------------------------------------------ 
# 

admin/index.php

# 
#-----[ FIND ]------------------------------------------ 
# 

						case PAGE_FAQ:
							$location = $lang['Viewing_FAQ'];
							$location_url = "index.$phpEx?pane=right";
							break;

# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 

						case PAGE_SPORTS:
							$location = $lang['viewonlinesports'];
							$location_url = "fsports.$phpEx";
							break;

# 
#-----[ OPEN ]------------------------------------------ 
# 

includes/constants.php

# 
#-----[ FIND ]------------------------------------------ 
# 

define('PAGE_TOPIC_OFFSET', 5000);

# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 

define('PAGE_SPORTS', 6969);

# 
#-----[ FIND ]------------------------------------------ 
# 

define('USERS_TABLE',  $table_prefix.'users');

# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 

define('FSPORTS_PRED_TABLE',  $table_prefix.'fsports_pred');
define('FSPORTS_GAMES_TABLE',  $table_prefix.'fsports_games');
define('FSPORTS_TEAMS_TABLE',  $table_prefix.'fsports_teams');
define('FSPORTS_STATS_TABLE',  $table_prefix.'fsports_stats');

# 
#-----[ OPEN ]------------------------------------------ 
#

includes/page_header.php

# 
#-----[ FIND ]------------------------------------------ 
# 

	'L_FAQ' => $lang['FAQ'],

# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 

	'L_TEAMNAME' => $lang['Teamname'],
	'L_WINS' => $lang['Wins'],
	'L_TIES' => $lang['ties'],
	'L_LOSSES' => $lang['Losses'],
	'L_PERCENTAGE' => $lang['FS_Percentage'],
	'L_GAMETIME' => $lang['gametime'],
	'L_HOMETEAM' => $lang['hometeam'],
	'L_AWAYTEAM' => $lang['awayteam'],
	'L_FSPORTSUSERNAME' => $lang['fsportsusername'],
	'L_POINTS' => $lang['points'],
	'L_POINTDIFF' => $lang['pointdiff'],
	'L_LEADERBOARD' => $lang['leaderboard_header'],
	'L_UPCOMING_GAMES' => $lang['upcoming_games_header'],
	'L_TEAM_WINNING_PERC' => $lang['teamwinperc_header'],
	'U_FSPORTS' => append_sid('fsports.'.$phpEx),
	'L_FSPORTS' => $lang['fsports'],
	'L_PREDICTIONSFOR' => $lang['predictionsfor'],
	'L_AWAYSCORE' => $lang['awayscore'],
	'L_HOMESCORE' => $lang['homescore'],
	'L_PASTGAMES' => $lang['pastgamesheader'],

# 
#-----[ OPEN ]------------------------------------------ 
#

language/lang_english/lang_main.php

# 
#-----[ FIND ]------------------------------------------ 
# 

?>

# 
#-----[ BEFORE, ADD ]------------------------------------------ 
#
// added for fantasy sports game
$lang['fsports'] = 'Fantasy Sports';
$lang['Teamname'] = 'Teamname';
$lang['Wins'] = 'Wins';
$lang['ties'] = 'Ties';
$lang['Losses'] = 'Losses';
$lang['FS_Percentage'] = 'Winning %';
$lang['gametime'] = 'Time';
$lang['hometeam'] = 'Home';
$lang['awayteam'] = 'Away';
$lang['fsportsusername'] = 'User Name';
$lang['points'] = 'Points';
$lang['pointdiff'] = 'Point Diff';
$lang['leaderboard_header'] = 'LEADERBOARD';
$lang['upcoming_games_header'] = 'Upcoming Games';
$lang['teamwinperc_header'] = 'Team Winning %';
$lang['viewonlinesports'] = 'Playing the Fantasy sports game';
$lang['predictionsfor'] = 'Predictions for';
$lang['awayscore'] = 'Away Score';
$lang['homescore'] = 'Home Score';
$lang['fsportssuccess'] = 'You have successfully entered your predictions!!';
$lang['click_view_fsports'] = 'Click %shere%s to return to the Standings page';
$lang['click_return_pred'] = 'Click %shere%s to return to the Prediction page';
$lang['pastgamesheader'] = 'Recent Games Played';
$lang['edit'] = 'Edit';
$lang['gamenotstarted'] = 'The game hasn\'t started yet, please come back later!!!';
// end

# 
#-----[ OPEN ]------------------------------------------ 
#

language/lang_english/lang_admin.php

# 
#-----[ FIND ]------------------------------------------ 
# 

?>

# 
#-----[ BEFORE, ADD ]------------------------------------------ 
#

// added for fantasy sports game
$lang['fsgeneralsettings'] = 'GENERAL SETTINGS';
$lang['fsportsconfigheader'] = 'Fantasy Sports Configuration';
$lang['fsportsexplain'] = 'Here you can enter the configuration for the Fantasy Sports Hack.';
$lang['correct_result'] = 'Points for picking the correct winner';
$lang['correct_score'] = 'Points for predicting the exact score';
$lang['click_return_fsconfig'] = 'Click %shere%s to return to the Fantasy Sports configuration menu';
$lang['adminteamheader'] = 'TEAM MANAGEMENT';
$lang['adminaddteam'] = 'ADD TEAMS';
$lang['admineditteam'] = 'EDIT TEAM';
$lang['addteambuttontext'] = 'ADD NEW TEAM';
$lang['editteambuttontext'] = 'EDIT EXISTING TEAM';
$lang['deleteteambuttontext'] = 'DELETE MARKED TEAMS';
$lang['saveteambuttontext'] = 'SAVE UPDATED TEAMNAMES';
$lang['teammanage'] = 'Current Teams';
$lang['newteamname'] = 'New Teamname';
$lang['deleteteam'] = 'Delete';
$lang['addteamexplain'] = 'Enter your teamnames here.  Don\'t worry, if you leave a field blank, it will skip that field.';
$lang['editteamlistexplain'] = 'Enter the new teamname here.  If you wish to delete the team, leave the field blank';
$lang['teamexplain'] = 'Here are all of the teams currently in the database.  Choose an option below to either enter new teams or edit existing teams.';
$lang['addteamsuccess'] = 'You have added these teams successfully';
$lang['click_return_addteams'] = 'Click %shere%s to return to add more teams';
$lang['Teamname'] = 'Teamname';
$lang['admingamesheader'] = 'GAME MANAGEMENT';
$lang['adminaddgame'] = 'ADD GAME';
$lang['admineditgame'] = 'EDIT GAME';
$lang['savegamesbuttontext'] = 'SAVE GAMES';
$lang['upcominggames'] = 'Upcoming Games';
$lang['hometeamname'] = 'Home Team';
$lang['awayteamname'] = 'Away Team';
$lang['addgametime'] = 'Time (Format HH:MM)';
$lang['addgamedate'] = 'Date (Format MM-DD-YYYY)';
$lang['gamesaddexplain'] = 'Fill out each box, paying close attention to the format.  If the format is wrong, there will be errors in entering your games.  If you want to enter less than 5 games, leave the unused rows blank.';
$lang['gameseditexplain'] = 'You can change any of the game information here.  To delete a game, leave the date and time blank and the game will be deleted.';
$lang['showgamesexplain'] = 'Here are all of the scheduled games.  Select an option below to either add a game or edit a game.';
$lang['addgamesuccess'] = 'You have added %s games successfully';
$lang['click_return_addgames'] = 'Click %shere%s to return to add more games';
$lang['scoresheader'] = 'SCORE MANAGEMENT';
$lang['adminaddscores'] = 'ADD\EDIT SCORES';
$lang['savescoresbuttontext'] = 'SAVE SCORES';
$lang['oneweekbuttontext'] = 'ONE WEEK AGO';
$lang['twoweeksbuttontext'] = 'TWO WEEKS AGO';
$lang['monthbuttontext'] = 'ONE MONTH AGO';
$lang['allgamesbuttontext'] = 'ALL GAMES';
$lang['savescoresbuttontext'] = 'SAVE SCORES';
$lang['scoresexplain'] = 'Choose the timespan of the games that you wish to view.  WARNING!! CHOOSING ALL GAMES WILL QUERY ALL GAMES FROM THE DB WHOSE GAMETIME HAS PASSED.';
$lang['scoreseditexplain'] = 'Enter the scores of all of the games below.  If you do not know the score of the game yet, enter the score as 0-0 and the game will not be counted in the standings.';
$lang['picktime'] = 'Select Timespan';
$lang['admingametime'] = 'Gametime';
$lang['adminscore'] = 'Score';
$lang['addscoressuccess'] = 'You have updated the scores successfully';
$lang['click_return_addscores'] = 'Click %shere%s to return to add more scores';
$lang['edit'] = 'Edit';
$lang['submitfs'] = 'Submit';
// end

# 
#-----[ OPEN ]------------------------------------------ 
#

templates/subSilver/overall_header.tpl

# 
#-----[ FIND ]------------------------------------------ 
#

<a href="{U_LOGIN_LOGOUT}" class="mainmenu"><img src="templates/subSilver/images/icon_mini_login.gif" width="12" height="13" border="0" alt="{L_LOGIN_LOGOUT}" hspace="3" />{L_LOGIN_LOGOUT}</a>&nbsp;</span>

# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 

&nbsp;&nbsp;<a href="{U_FSPORTS}" class="mainmenu"><img src="templates/subSilver/images/icon_mini_predict.gif" width="12" height="13" border="0" alt="{L_FSPORTS}" hspace="3" />{L_FSPORTS}</a>

# 
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------ 
# 
# EoM 
